// src/main.js
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import store from './store'
import request from '@/utils/request' // 从 utils 引入统一请求工具

// 引入路由守卫
import './router/guard'

const app = createApp(App)

// 挂载全局请求实例
app.config.globalProperties.$api = request

app.use(store)
app.use(router)
app.use(ElementPlus)

// 全局过滤器
app.config.globalProperties.$filters = {
  formatDate(value) {
    // 格式化日期...
    return value
  }
}

app.mount('#app')